package test;

import uci.rt.ccr.engine.matrix.Mat;

public class OctaveTeste
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		//testequals();
		interpolation();
		/*int cols=5;
		double[] xx = new double[cols];
		for(int col=0;col<cols;col++){
			xx[col]=col+1;
		}
		double [] yy = new double[cols+1];
		System.arraycopy(xx, 0, yy, 1, xx.length);
		System.out.println(yy.toString());*/

	}

	private static void interpolation()
	{
		int cols=5;
		double[][] xx = new double[1][cols];
		for(int col=0;col<cols;col++){
			xx[0][col]=col*2;
		}
		
		double[][] yy = new double[1][cols];
		for(int col=0;col<cols;col++){
			yy[0][col]=xx[0][col]*xx[0][col];
		}
		double [][] nx = new double [1][1];
		nx[0][0]=-1;
		
		Mat x = new Mat("x",xx);		
		Mat y = new Mat("y",yy);		
		Mat newX = new Mat("newX",nx);
		
		Mat newY=Mat.linint("newY", x, y, newX);
		x.print();
		y.print();
		newX.print();
		newY.print();
		
	}

	private static void testequals()
	{
		int cols=5;
		int[] a = new int[cols];
		for(int col=0;col<cols;col++){
			a[col]=col;
		}
		int b[] = a;


		int[] c = new int[cols];
		for(int col=0;col<cols;col++){
			c[col]=col;
		}
		System.out.println("a.equals(a): "+a.equals(a));
		System.out.println("a.equals(b): "+a.equals(b));
		System.out.println("a.equals(c): "+a.equals(c));
		
	}

}
